package com.uniview.web.contorller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.uniview.base.BaseController;

@Controller
@RequestMapping(value = "/admin")
public class HomeController extends BaseController {
	Logger logger = Logger.getLogger(HomeController.class);

	@Value("#{configProperties['uniview.version']}")
	private String version;
	
	@RequestMapping(value = "/index")
	public ModelAndView index(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("index");
		String basePath = request.getServletContext().getContextPath();
		view.addObject("basePath", basePath);
		view.addObject("version", version);
		view.addObject("token", request.getParameter("token"));
		return view;
	}
}
